]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
runDialog: catch the case where no completion is available
authorCosimo Cecchi <cosimo@endlessm.com>
Wed, 13 Aug 2014 22:13:20 +0000 (15:13 -0700)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 19 Aug 2014 16:39:51 +0000 (09:39 -0700)
Just return null, instead of failing with an exception later trying to
call substr() on null.

https://bugzilla.gnome.org/show_bug.cgi?id=735062

js/ui/runDialog.js

index 1d5e7a5dca35483eaa3c42f37b3515fc95d554f3..9c9ee6706e46996b430e640aeda19a373143ac35 100644 (file)
@@ -182,6 +182,10 @@ const RunDialog = new Lang.Class({
         let results = someResults.reduce(function(a, b) {
             return a.concat(b);
         }, []);
+
+        if (!results.length)
+            return null;
+
         let common = results.reduce(_getCommon, null);
         return common.substr(text.length);
     },